<?php
    //phpinfo();
    header("Content-Type:text/html;charset=utf-8;");
	//echo "五点多撒";
	//sleep(2);
	$length = $_POST['length'];
	$width  = $_POST['width'];
	//echo $length;
	//echo $width;	
	//echo $long;
	class squareress{
		private $length;
		private $width;
		public function __construct ($length=0,$width=0){
			$this -> length = $length;
			$this -> width  = $width;
		}
		public function zc () {
			return  2*(($this -> length)+($this -> width));
		}
		public function mj () {
			return  ($this -> length)*($this -> width);
		}
		public function isquareress (){
			if($this -> length==$this -> width){
				if($this -> length && $this -> width){
					return TRUE;
				}else{
					return FALSE;	
				}				
			}else{
				return FALSE;
			}
		}
	}
	////////////////////////////////////////////////////
	
	////////////////////////////////////////////////////
	$sqr=new squareress($length,$width);
	$zc=$sqr -> zc();
	$mj=$sqr -> mj();
	$isq=$sqr -> isquareress();
	
	$json=array('mianji'=>$mj,'zhouchang'=>$zc,'isq'=>$isq);  
	//$js="{'mianji':$mj,'zhouchang':$zc}"; 
	//$data = "{'area' : $area,'per' : $per}";
	//echo "<hr>";
	//echo $data;
	//echo "<hr>";
	//echo $js; 
	//echo "<hr>";
	echo json_encode($json);
?>